package top.stmo.blog.dao.vo;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 统一结果数据封装类
 */

@Data
@AllArgsConstructor         //自动生成全部参数的构造方法
public class Result {

    protected boolean success;

    protected int code;

    protected String msg;

    protected Object data;



    public static Result success(Object data) {

        return new Result(true,200,"success",data);
    }

    public static Result fail(int code,String msg) {

        return new Result(false,code,msg,null);
    }

}
